module.exports = app => {
    const mongoose = require('mongoose')
    mongoose.connect('mongodb://localhost:27017/shopping', {
        useUnifiedTopology: true,
        useNewUrlParser: true
    }).then(() => {
        console.log("链接成功");
    }).catch(() => {
        console.log("链接失败");
    })


    // 将models里面的js文件全部引用
    require('require-all')(__dirname + '/./models')
}